package com.example.springsecurity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springsecurity.entity.SystemRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 角色信息表(SystemRole)表数据库访问层
 *
 * @author aman
 * @since 2025-01-15 16:58:54
 */
@Mapper
public interface SystemRoleMapper extends BaseMapper<SystemRole> {

    @Select("select tsr.code from system_role tsr where tsr.id in (select role_id from system_user_role where user_id = ${id})")
    List<String> getUserRole(Long id);
    
}
